/** 
* This class assign owner to Accounts.
*
* Client - Cisco Systems (Linksys)
* 
* Author - Manu Dhingra
* Cretaed - Feb 2010
* Last Update - Feb 2010
* 
**/

global class accountAssignmentProcess {

// This method check for assignment rules for assigning right owner. 
webservice static void assignmentRules() {

    accountAssignmentBatch assignAccount = new accountAssignmentBatch(); 
 /*   assignAccount.lastRunTime = [SELECT max(AsyncApexJob.completedDate) FROM AsyncApexJob 
    								WHERE AsyncApexJob.ApexClass.Name ='accountAssignmentBatch' 
    								AND  AsyncApexJob.Status ='Completed'
    								GROUP BY AsyncApexJob.ApexClassId];
   */
    assignAccount.email='madhingr@cisco.com';

    ID batchprocessid = Database.executeBatch(assignAccount,20);
    system.debug(batchprocessid);

}

@isTest 
    static void accountAssignmentTest(){ 
            accountAssignmentProcess.assignmentRules();
    }
    

}